package com.karry.commons.base;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import java.util.Date;

public class SuperEntity {
    /**
     * 主键
     */
    @JsonSerialize(using= ToStringSerializer.class)
    protected Long id;

    /**
     * 创建日期
     */
    @TableField(fill = FieldFill.INSERT)
    protected Date createdTime;

    /**
     * 最后修改日期
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    protected Date lastModifiedTime;

    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    protected int deleted;  //是否删除  0 : 未删除  1： 删除

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getLastModifiedTime() {
        return lastModifiedTime;
    }

    public void setLastModifiedTime(Date lastModifiedTime) {
        this.lastModifiedTime = lastModifiedTime;
    }

    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }
}
